﻿@using HrEFCore
@model ER
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<!-- 引入样式 -->
	<script src="~/aa/element-ui/lib/index.js"></script>
	<!-- 引入组件库 -->
	<link href="~/aa/element-ui/lib/theme-chalk/index.css" rel="stylesheet" />
	<script src="~/aa/jquery-3.4.1.js"></script>
	<script src="~/aa/jquery.validate.js"></script>
	<script src="~/aa/jquery.validate.unobtrusive.js"></script>
	<script src="~/aa/vue/dist/vue.js"></script>
	<script src="~/aa/element-ui/lib/index.js"></script>
	<link href="~/aa/element-ui/lib/theme-chalk/index.css" rel="stylesheet" />
	<script src="~/aa/axios/dist/axios.js"></script>
	<link rel="stylesheet" href="~/css/table.css" type="text/css"></link>
	<script type="text/javascript" src="~/javascript/comm/comm.js"></script>
	<script type="text/javascript" src="~/javascript/jquery-1.7.2.js"></script>
	<style type="text/css">
		.s {
			color: red;
		}

		body {
			background: rgb(253,244,227);
		}

		.TD_STYLE1 {
			background: #E6DDCE;
			/* color:white; */
		}

		.TD_STYLE2 {
			background: rgb(253,244,227);
		}

		.INPUT_STYLE2 {
			background: rgb(253,244,227);
		}
	</style>
</head>
<body>
	<form action="/HF/Add" method="post" id="hfAdd">
		<table style="width:100%;margin-top:10px;height:30px;background-color:rgb(253,244,227)">
			<tr>
				<td>
					<font color="black">
						您正在做的业务是：人力资源--人力资源档案管理--人力资源档案登记
					</font>
				</td>
			</tr>
			<tr>
				<td style="float:right;margin-bottom:10px;margin-right:20px">
					<input type="submit" value="提交" class="BUTTON_STYLE1"/>
					<input type="reset" value="清除" class="BUTTON_STYLE1" />
				</td>
			</tr>
		</table>
		<table width="100%" border="1" cellpadding=3 cellspacing=1
			   bordercolorlight=#848284 bordercolordark=#eeeeee
			   class="TABLE_STYLE1 table-bordered">
			<tr>
				<td class="TD_STYLE1" width="11%">
					机构名称
				</td>
				<td width="20%" class="TD_STYLE2">
					<el-cascader :options="options" v-model="value" v-on:change="handleChange"></el-cascader> 
					<input type="text" style="display:none" v-model="firstid" name="FirstKindId"/>
					<input type="text" style="display:none" v-model="secondid" name="SecondKindId"/>
					<input type="text" style="display:none" v-model="thirdid" name="ThirdKindId"/>
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					职位分类
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanMajorKindName" class="form-control" value="@Model.HumanMajorKindName" />
					<input type="text" name="HumanMajorKindId" class="form-control" value="@Model.HumanMajorKindId" style="display:none" />
				</td>
				<td class="TD_STYLE1" width="5%">
					职位名称
				</td>
				<td class="TD_STYLE2" width="200px">
					<input type="text" name="HunmaMajorName" class="form-control" value="@Model.HunmaMajorName" />
					<input type="text" name="HumanMajorId" class="form-control" value="@Model.HumanMajorId" style="display:none"/>
				</td>
				<td class="TD_STYLE1" width="5%">
					职称
				</td>
				<td colspan="2" class="TD_STYLE2">
					@* @Html.DropDownListFor(e=>e.HumanProDesignation,ViewBag.zc as IEnumerable<SelectListItem>,new{@class="form-control"}) *@
					@Html.DropDownList("HumanProDesignation", ViewBag.zc as SelectList, new{@class="form-control"})
				</td>
				<td rowspan="4">
					@* <el-upload class="avatar-uploader"
							   action="/HF/WJSC"
							   :show-file-list="false"
							   :on-success="handleAvatarSuccess"
							   :before-upload="beforeAvatarUpload">
						<img v-if="imageUrl" :src="imageUrl" class="avatar" style="width:150px;height:150px">
						<i v-else class="el-icon-plus avatar-uploader-icon"></i>
					</el-upload>	 *@	
					<img src="~/@Model.HumanPicture" class="avatar" style="width:150px;height:150px"/>
					<input type="text" value="@Model.HumanPicture" name="HumanPicture" style="display:none"/>
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					姓名
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanName" class="form-control" value="@Model.HumanName" />
				</td>
				<td class="TD_STYLE1">
					性别
					@Html.LabelFor(e=>e.HumanSex)
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanSex" class="form-control" value="@Model.HumanSex" />
				</td>
				<td class="TD_STYLE1">
					EMAIL
				</td>
				<td colspan="2" class="TD_STYLE2">
					<input type="text" name="HumanEmail" class="form-control" value="@Model.HumanEmail" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					电话
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanTelephone" class="form-control" value="@Model.HumanTelephone" />
				</td>
				<td class="TD_STYLE1">
					QQ
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanQQ" class="form-control" required/>
				</td>
				<td class="TD_STYLE1">
					手机
				</td>
				<td colspan="2" class="TD_STYLE2">
					<input type="text" name="HumanMobilephone" class="form-control" value="@Model.HumanMobilephone" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					住址
				</td>
				<td colspan="3" class="TD_STYLE2">
					<input type="text" name="HumanAddress" class="form-control" value="@Model.HumanAddress" />
				</td>
				<td class="TD_STYLE1">
					邮编
				</td>
				<td colspan="2" class="TD_STYLE2">
					<input type="text" name="HumanPostcode" class="form-control" value="@Model.HumanPostcode" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					国籍
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanNationality" class="form-control" value="@Model.HumanNationality" />
				</td>
				<td class="TD_STYLE1">
					出生地
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanBirthplace" class="form-control" value="@Model.HumanBirthplace" />
				</td>
				<td class="TD_STYLE1">
					生日
				</td>
				<td width="18%" class="TD_STYLE2">
					<input type="text" name="HumanBirthday" class="form-control" value="@Model.HumanBirthday" />
				</td>
				<td width="9%" class="TD_STYLE1">
					民族
				</td>
				<td class="TD_STYLE2" width="14%">
					<input type="text" name="HumanRace" class="form-control" value="@Model.HumanRace" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					宗教信仰
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanReligion" class="form-control" value="@Model.HumanReligion" />
				</td>
				<td class="TD_STYLE1">
					政治面貌
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanParty" class="form-control" value="@Model.HumanParty" />
				</td>
				<td class="TD_STYLE1">
					身份证号码
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanIdcard" class="form-control" value="@Model.HumanIdcard" />
				</td>
				<td class="TD_STYLE1">
					社会保障号码
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanSocietySecurityId" class="form-control" required/>
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					年龄
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanAge" class="form-control" value="@Model.HumanAge" />
				</td>
				<td class="TD_STYLE1">
					学历
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanEducatedDegree" class="form-control" value="@Model.HumanEducatedDegree" />
				</td>
				<td class="TD_STYLE1">
					教育年限
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanEducatedYears" class="form-control" value="@Model.HumanEducatedYears" />
				</td>
				<td class="TD_STYLE1">
					学历专业
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanEducatedMajor" class="form-control" value="@Model.HumanEducatedMajor" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					薪酬标准
				</td>
				<td class="TD_STYLE2">
					@* @Html.DropDownList("SalaryStandardName", ViewBag.xc as SelectList ,new{@class="form-control", onchange = "handleChange2"}) *@
					<select v-model="newsalarySun" v-on:change="handleChange2" class="form-control" name="SalaryStandardId">
						@foreach (var item in ViewBag.xc as IEnumerable<SelectListItem>)
						{
							<option value="@item.Value">@item.Text</option>
						}
					</select>
				</td>
				<td class="TD_STYLE1">
					开户行
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanBank" class="form-control" />
				</td>
				<td class="TD_STYLE1">
					帐号
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanAccount" class="form-control" />
				</td>
				<td class="TD_STYLE1">
					登记人
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="Register" class="form-control" value="@ViewBag.uname" readonly="readonly" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					建档时间
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="RegistTime" class="form-control" value="@DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")" readonly="readonly"/>
				</td>
				<td class="TD_STYLE1">
					特长
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanSpeciality" class="form-control" value="@Model.HumanSpeciality" />
				</td>
				<td class="TD_STYLE1">
					爱好
				</td>
				<td class="TD_STYLE2">
					<input type="text" name="HumanHobby" class="form-control" value="@Model.HumanHobby" />
				</td>
				<td class="TD_STYLE1">
					&nbsp;
				</td>
				<td class="TD_STYLE2">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					个人履历
				</td>
				<td colspan="7" class="TD_STYLE2">
					<input type="text" name="HumanHistroyRecords" class="form-control" value="@Model.HumanHistoryRecords" />
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					家庭关系信息
				</td>
				<td colspan="7" class="TD_STYLE2">
					<input type="text" name="HumanFamilyMembership" class="form-control"/>
				</td>
			</tr>
			<tr>
				<td class="TD_STYLE1">
					备注
				</td>
				<td colspan="7" class="TD_STYLE2">
					<input type="text" name="Remark" class="form-control"/>
				</td>
			</tr>
		</table>
	</form>
	<script>
		new Vue({
			el: '#hfAdd',
			data: {
				value:"",
				options: [],
				firstid:"",
				secondid:"",
				thirdid:"",
				imageUrl: '', /* 文件上传 */
				HumanMajorKindId:'',
				MajorName:[],
				idCard: '',
				birthday: '',
				gender: '',
				age: '',
				money:'',
				newsalarySun:''
			},
			methods: {
				fill() {
					axios.get('/HF/GetFirstKinds').then(res=>{
						this.options = res.data.map(item => {
							return {
								value: item.value,
								label: item.label,
								children: item.children
							};
						});
					}).catch(err => {
						console.log(err);
					})
				},
				handleChange(value){
					console.log('值', value); 
					if(value != null){
						this.firstid = value[0];
						this.secondid = value[1];
						this.thirdid = value[2];
					}
				},
				// 文件上传
				handleAvatarSuccess(res, file) {
					this.imageUrl = URL.createObjectURL(file.raw);
				},
				beforeAvatarUpload(file) {
					const isJPG = file.type === 'image/jpeg';
					const isLt2M = file.size / 1024 / 1024 < 2;

					if (!isJPG) {
						this.$message.error('上传头像图片只能是 JPG 格式!');
					}
					if (!isLt2M) {
						this.$message.error('上传头像图片大小不能超过 2MB!');
					}
					return isJPG && isLt2M;
				},
				getName: function () {
					axios.get('/HF/GetName', {
						params: {
							id: this.HumanMajorKindId
						}
					}).then(res => {
						this.MajorName = res.data;
					}).catch(err => {
						console.log(err);
					})
				},
				parseIdCard() {
					if (this.idCard.length === 18) {
						// 解析身份证号获取生日、性别等信息
						var birthday = this.idCard.substring(6, 10) + '-' + this.idCard.substring(10, 12) + '-' + this.idCard.substring(12, 14);
						var genderCode = this.idCard.substring(16, 17);
						var gender = genderCode % 2 === 0 ? '女' : '男';
						var age = new Date().getFullYear() - parseInt(this.idCard.substring(6, 10));

						// 将解析出的信息赋值给对应的Vue数据属性
						this.birthday = birthday;
						this.gender = gender;
						this.age = age;
					} else {
						// 身份证号格式不正确的处理逻辑
					}
				},
				// tc: function () {
				// 	axios.get("/HF/ERById").then(res => {
				// 		this.humanName
				// 	}).catch(err => {
				// 		console.log(err);
				// 	});
				// },
			},
			mounted: function () {
				this.fill();
				//this.tc();
			}
		})
	</script>
</body>
</html>